﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace MyPoints.UserControls.Converters
{
  public class LatLonConverter : IMultiValueConverter
  {
    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
    {
      string ret;
      if (values.Length == 2 && values[0] is decimal && values[1] is decimal)
        ret = string.Format("{0:0.000000} {1:0.000000}", (decimal)values[0], (decimal)values[1]);
      else
        ret = "N/A";
      return ret;
    }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
    {
      //TODO tohle určitě není dobře!
      return new object[] { 3.3, 3.3 };
    }
  }
}
